package bpm.dao.impl.fs;

import java.sql.ResultSet;
import java.sql.SQLException;
import java.util.Date;

import org.springframework.jdbc.core.RowMapper;

import bpm.domain.fs.Container;

/**
 * 
 * @author <a mailto="hwangsyin@gmail.com">King</a>
 *
 */
public class ContainerMapper implements RowMapper {

	public Object mapRow(ResultSet rs, int i) throws SQLException {
		Container c = new Container();
		
		c.setId(rs.getInt("id"));
		c.setContainer(rs.getString("container"));
		c.setCapacity(rs.getLong("capacity"));
		c.setFree(rs.getLong("free"));
		c.setEnableString(rs.getString("enable"));
		c.setCreateTime(new Date(rs.getTime("create_time").getTime()));
		c.setLastUpdateTime(new Date(rs.getTime("last_update_time").getTime()));
		c.setDescription(rs.getString("description"));
		
		return c;
	}
}
